home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 885 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  4.2 KB

  1. Path: redstone.interpath.net!usenet
  2. From: fortunat@interpath.com (Jumpstile Turner)
  3. Newsgroups: comp.graphics.algorithms,comp.lang.c++,comp.os.ms-windows.programmer.graphics,comp.os.ms-windows.programmer.multimedia,comp.os.ms-windows.programmer.win32
  4. Subject: Re: IJG JPEG Engine and Win32
  5. Date: 8 Jan 1996 00:04:11 GMT
  6. Organization: Completely unorganized
  7. Message-ID: <4cpn1r$gm0@redstone.interpath.net>
  8. References: <4cemir$6vb@redstone.interpath.net> <TGL.96Jan3202549@netcom21.netcom.com> <TGL.96Jan5065424@netcom21.netcom.com>
  9. NNTP-Posting-Host: fortunat.pdial.interpath.net
  10. X-Newsreader: WinVN 0.99.7
  11.  
  12. In article <TGL.96Jan5065424@netcom21.netcom.com>, tgl@netcom.com 
  13. said:
  14. >Just change the definition of boolean in jmorecfg.h.  There's 
  15. specific
  16. >advice to do that for Windows apps in install.doc, btw.
  17.  
  18.   This I did and it solved a LOT of problems. :) Thanks.  I didn't 
  19. see the reference in install.doc.
  20.  
  21. >> API functions (i.e. CreateFile instead of fopen, ReadFile 
  22. instead of the 
  23. >> JFREAD macro, HeapAlloc instead of malloc) and everything 
  24. appears to work
  25. >> until I try to allocate a buffer with the jpeglib's memory 
  26. allocation 
  27. >> functions.  Then I get an invalid page fault.
  28. >
  29. >Hm.  That one I don't have an answer for offhand.  Which memory 
  30. manager
  31. >back end are you using --- jmemnobs.c, or something more complex?
  32. >
  33.  
  34.   Jmemnobs.c.  After much fudging around with the code I finally 
  35. got it going. I'm not sure exactly what change made the difference. 
  36.  I've had so many problems getting this thing to compile my head is 
  37. spinning.  I think I'm going to go get VC++ 4.0. :)  
  38.  
  39.   Unfortunately I still can't get the library to work with my 
  40. current application.  I made a short and quick Windows app to test 
  41. how the library functions under the GUI and now I can get it to 
  42. work every time with that, but if I try to integrate it into the my 
  43. major project it chokes like it always did.  I still get the 
  44. strange structure interpretation problems.   I've changed every 
  45. compiler setting I can think of (including making sure the 
  46. alignment options match like someone mentioned) and I've concluded 
  47. that it must be something in one of my includes because no change I 
  48. make seems to fix it.  Checking the cinfo structure after it comes 
  49. back from jpeg_read_header shows that cinfo.image_width and 
  50. cinfo.image_height are correct, however almost every field with  
  51. "output_xxxx" is way off, either 1, 0, or some rediculous number 
  52. like 7988774.  Of course this causes every other call after that to 
  53. choke and I end up with an invalid page fault in Kernel32.dll.  
  54. This library is pretty picky! :)  
  55.  
  56. >Yes, it is.  Here's the latest dope from the current version of 
  57. install.doc
  58. >:
  59. >Borland C++ 4.5 fails with an internal compiler error when trying 
  60. to compil
  61. >e
  62. >jdmerge.c in 32-bit mode.  If enough people complain, perhaps 
  63. Borland will 
  64. >fix
  65. >it.  In the meantime, the simplest known workaround is to add a 
  66. redundant
  67. >definition of the variable range_limit in h2v1_merged_upsample(), 
  68. at the he
  69. >ad
  70. >of the block that handles odd image width (about line 268 in v6 
  71. jdmerge.c):
  72. >  /* If image width is odd, do the last output column separately 
  73. */
  74. >  if (cinfo->output_width & 1) {
  75. >    register JSAMPLE * range_limit = cinfo->sample_range_limit; /* 
  76. ADD THIS
  77. > */
  78. >    cb = GETJSAMPLE(*inptr1);
  79. >Pretty bizarre, especially since the very similar routine 
  80. h2v2_merged_upsam
  81. >ple
  82. >doesn't trigger the bug.
  83.  
  84.   Thanks for the tip!  I'll make the changes.  I don't know if you 
  85. are aware of this,  but if you use the BCC32a instead of plain 
  86. BCC32 it will compile without a hitch.  The BCC32a is for Pentium 
  87. scheduler support and of course has a different back-end than 
  88. BCC32.
  89.  
  90.  
  91.   I haven't gone through all the code yet, but all I really need to 
  92. do is decode a JPEG file to its normal dimensions (no scaling) at 
  93. 24 bits per pixel.  How difficult would it be to strip out 
  94. everything except support for that.  At a quick glance it seems 
  95. everything is tightly integrated.  I also don't need any of the 
  96. virtual array functions since I've got over a 2 gig virtual address 
  97. space.
  98.  
  99.            -Scott
  100.  
  101. ------------------------------------------------
  102. Jumpstile Turner
  103. fortunat@interpath.com
  104. "Sing the Hare Hare, Dance the Hoochie Koo..."
  105. ------------------------------------------------
  106.  
  107.